#pragma once
#include "DSpace.h"

namespace Skill
{
	namespace Ode
	{		
		public ref class DSweepAndPruneSpace : DSpace
		{		
		public:

			enum class SapAxes : int
			{
				XYZ = dSAP_AXES_XYZ,  //((0)|(1<<2)|(2<<4))
				XZY = dSAP_AXES_XZY,  //((0)|(2<<2)|(1<<4))
				YXZ = dSAP_AXES_YXZ,  //((1)|(0<<2)|(2<<4))
				YZX = dSAP_AXES_YZX,  //((1)|(2<<2)|(0<<4))
				ZXY = dSAP_AXES_ZXY,  //((2)|(0<<2)|(1<<4))
				ZYX = dSAP_AXES_ZYX  //((2)|(1<<2)|(0<<4))
			};

			/// <summary>
			/// Create a DSweepAndPruneSpace
			/// </summary>
			/// <param name = "space"> Parent space (can be null)</param> 
			/// <param name = "axisorder"> Order XZY or ZXY usually works best, if your Y is up.</param> 
			DSweepAndPruneSpace(DSpace^ space , SapAxes axisorder)
				:DSpace()
			{
				if(space)
					_SetPointer(dSweepAndPruneSpaceCreate(space->_Space(),(int)axisorder),true);
				else
					_SetPointer(dSweepAndPruneSpaceCreate(nullptr,(int)axisorder),true);
				_Container = space;
			}

		};		
	}
}